﻿<!DOCTYPE html>
<!--基于风险信息库的安全措施-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <style>
        body {
            padding-bottom: 10px;
        }
    </style>
</head>
<body>
    
<div id="app" v-cloak>   

        <el-form :model="Form" status-icon style="margin-top:5px;width:100%">
            <div style="width:100% ">
                <label style="font-weight:bold">一、基础安全措施</label>
            </div>
            <el-row>
                <el-col span="18">
                    {{Form.BasicSecurityMeasuresComment}}
                </el-col>
                <el-col span="6">
                    <el-button type="primary" @click="shiyong()">适用</el-button>
                    <el-button type="primary" @click="bushiyong()">不适用</el-button>
                </el-col>
            </el-row>

            <el-row>
                <el-col span="24">
                    <el-input type="textarea" style="width:90%;margin-top:3px;border:none" v-model="Form.BasicSecurityMeasures"></el-input>
                </el-col>
            </el-row>

            <div style="width:100% ">
                <label style="font-weight:bold">二、基于安全风险信息库的安全措施</label>
            </div>

            <el-row>
                <el-col span="18">
                    1. 设备设施 是否在企业正常作业活动开展的环境下，开展维修活动？（如选择“是”，进入安全风险信息
                    库，获取对应的作业活动的安全风险信息，确定安全风险是否对维修人员产生影响，考虑对维
                    修人员的风险控制措施。）
                </el-col>
                <el-col span="6">
                    <el-button type="primary" @click="EquipmenFacilitiesInput('tj')">是</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">否</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="24">
                    <el-table :data="Form.OperationRelatedActivitiesRish"
                              border
                              style="width:90%">

                        <el-table-column prop="Risk"
                                         :label="JSPAnalyticalManagement.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirement"
                                         :label="JSPAnalyticalManagement.ControlRequirements">
                        </el-table-column>
                        <el-table-column label="操作" width="70px">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.OperationRelatedActivitiesRish)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>

            <el-row>
                <el-col span="18">
                    2. 检维修作业活动 是否在企业正常作业活动开展的环境下，开展维修活动？（如选择“是”，进入安全风险信息
                    库，获取对应的作业活动的安全风险信息，确定安全风险是否对维修人员产生影响，考虑对维
                    修人员的风险控制措施。）
                </el-col>
                <el-col span="6">
                    <el-button type="primary" @click="InspectionMaintenanceActivitiesInput('tj')">是</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">否</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="24">
                    <el-table :data="Form.ActivityRish"
                              border
                              style="width:90%">

                        <el-table-column prop="Risk"
                                         :label="JSPAnalyticalManagement.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirement"
                                         :label="JSPAnalyticalManagement.ControlRequirements">
                        </el-table-column>
                        <el-table-column label="操作"width="70px">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.ActivityRish)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>

            <el-row>
                <el-col span="18">
                    3.操作程序 是否在企业正常作业活动开展的环境下，开展维修活动？（如选择“是”，进入安全风险信息
                    库，获取对应的作业活动的安全风险信息，确定安全风险是否对维修人员产生影响，考虑对维
                    修人员的风险控制措施。）
                </el-col>
                <el-col span="6">
                    <el-button type="primary" @click="OperatingProceduresInput('tj')">是</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">否</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="24">
                    <el-table :data="Form.OperatingProcedureRish"
                              border
                              style="width:90%">
                        <el-table-column prop="Risk"
                                         :label="JSPAnalyticalManagement.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirement"
                                         :label="JSPAnalyticalManagement.ControlRequirements">
                        </el-table-column>
                        <el-table-column label="操作"width="70px">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.ActivityRish)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>

            <el-row>
                <el-col span="18">
                    4.操作及相关作业活动 是否在企业正常作业活动开展的环境下，开展维修活动？（如选择“是”，进入安全风险信息
                    库，获取对应的作业活动的安全风险信息，确定安全风险是否对维修人员产生影响，考虑对维
                    修人员的风险控制措施。）
                </el-col>
                <el-col span="6">
                    <el-button type="primary" @click="OperationRelatedActivitiesInput('tj')">是</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">否</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="24">
                    <el-table :data="Form.InspectionMaintenanceActivitiesRish"
                              border
                              style="width:90%">
                        <el-table-column prop="Risk"
                                         :label="JSPAnalyticalManagement.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirement"
                                         :label="JSPAnalyticalManagement.ControlRequirements">
                        </el-table-column>
                        <el-table-column label="操作" width="70px">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.InspectionMaintenanceActivitiesRish)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>

            <el-row>
                <el-col span="18">
                    5. 场所环境 是否在企业正常作业活动开展的环境下，开展维修活动？（如选择“是”，进入安全风险信息
                    库，获取对应的作业活动的安全风险信息，确定安全风险是否对维修人员产生影响，考虑对维
                    修人员的风险控制措施。）
                </el-col>
                <el-col span="6">
                    <el-button type="primary" @click="PlaceEnvironmentInput('tj')">是</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">否</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="24">
                    <el-table :data="Form.EquipmentFacilitiesRish"
                              border
                              style="width:90%">
                        <el-table-column prop="Risk"
                                         :label="JSPAnalyticalManagement.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirement"
                                         :label="JSPAnalyticalManagement.ControlRequirements">
                        </el-table-column>
                        <el-table-column label="操作" width="70px">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.EquipmentFacilitiesRish)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>

            <el-row>
                <el-col span="18">
                    6. 工艺介质 是否在企业正常作业活动开展的环境下，开展维修活动？（如选择“是”，进入安全风险信息
                    库，获取对应的作业活动的安全风险信息，确定安全风险是否对维修人员产生影响，考虑对维
                    修人员的风险控制措施。）
                </el-col>
                <el-col span="6">
                    <el-button type="primary" @click="ProcessMediumInput('tj')">是</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">否</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="24">
                    <el-table :data="Form.ProcessMediumRish"
                              border
                              style="width:90%">
                        <el-table-column prop="Risk"
                                         :label="JSPAnalyticalManagement.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirement"
                                         :label="JSPAnalyticalManagement.ControlRequirements">
                        </el-table-column>
                        <el-table-column label="操作" width="70px">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.ProcessMediumRish)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
           
            <el-row>
                <el-col span="18">
                    7.作业活动 是否在企业正常作业活动开展的环境下，开展维修活动？（如选择“是”，进入安全风险信息
                    库，获取对应的作业活动的安全风险信息，确定安全风险是否对维修人员产生影响，考虑对维
                    修人员的风险控制措施。）
                </el-col>
                <el-col span="6">
                    <el-button type="primary" @click="WorkAtivitiesInput('tj')">是</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">否</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="24">
                    <el-table :data="Form.PlaceEnvironmentRish"
                              border
                              style="width:90%">
                        <el-table-column prop="Risk"
                                         :label="JSPAnalyticalManagement.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirement"
                                         :label="JSPAnalyticalManagement.ControlRequirements">
                        </el-table-column>
                        <el-table-column label="操作" width="70px">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.PlaceEnvironmentRish)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <div style="width:100% ">
                <label style="font-weight:bold">三、其它安全措施</label>
            </div>
            <el-row>
                <el-col span="24">
                    <el-input type="textarea" style="width:90%;margin-top:3px;border:none" v-model="Form.BasicSecurityMeasuresOther"></el-input>
                </el-col>
            </el-row>
            <el-row>
                <el-form-item style="text-align:center; padding-top:5px">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>

        <el-dialog title="" :visible.sync="ListItem.dialogVisible" width="90%" height="95%" top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
     
        app = new Vue({
          
            el: '#app',
            data: {
                id: [],
                ids: '',
                Form: {
                    OperationRelatedActivitiesRish: '',//操作及相关作业活动风险
                    ActivityRish: '',//作业活动风险
                    OperatingProcedureRish: '',//操作程序风险
                    InspectionMaintenanceActivitiesRish: '',//检维修作业活动风险
                    EquipmentFacilitiesRish: '',//设备设施风险
                    ProcessMediumRish: '',//工艺介质风险
                    PlaceEnvironmentRish: '',//场所环境风险

                    RiskIdentificationSafety: '',//风险识别及安全措施
                    BasicSecurityMeasures: '', //基础安全措施
                    BasicSecurityMeasuresComment: '',
                    BasicSecurityMeasuresOther:'',
                },
                BasicSecurity: '1.  三级以上的吊装作业，应编制吊装作业方案。吊装物体质量虽不足40 t，但形状复杂、刚度小、' +
                   '长径比大、 精密贵重，以及在作业条件特殊的情况下，也应编制吊装作业方案，吊装作业方案应经审批。',
                OperationRelatedActivitiesRish:[],//操作及相关作业活动风险
                ActivityRish: [],//作业活动风险
                OperatingProcedureRish: [],//操作程序风险
                InspectionMaintenanceActivitiesRish:[],//检维修作业活动风险
                EquipmentFacilitiesRish: [],//设备设施风险
                ProcessMediumRish:[],//工艺介质风险
                PlaceEnvironmentRish: [],//场所环境风险

                rules: {},
                ListItem: ListItem,

            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                handleNodeClick: function (data) {
                    console.log(data);
                },
                deleteRow: function (index, rows) {
                    rows.splice(index, 1);
                },
                getData: function () {
                    getDataAdd(this, '/api/GeneralLiftingWorkSafety/getRish?id=' + this.ids);
                },
                shiyong: function () {
                    this.Form.BasicSecurityMeasures = this.BasicSecurity;
                    //parent.app.Form.Applicable = 1; //是否适用
                },
                shiyong: function () {
                    this.Form.BasicSecurityMeasures = this.BasicSecurity;
                    //parent.app.Form.Applicable = 0;//是否适用
                },
                EquipmenFacilitiesInput: function (val, id) { DialogShow(this, val, "../RiskControlInformationDatabase/EquipmenFacilitiesList.html", id); },
                InspectionMaintenanceActivitiesInput: function (val, id) { DialogShow(this, val, "../RiskControlInformationDatabase/InspectionMaintenanceActivitiesList.html", id); },
                OperatingProceduresInput: function (val, id) { DialogShow(this, val, "../RiskControlInformationDatabase/OperatingProceduresList.html", id); },
                OperationRelatedActivitiesInput: function (val, id) { DialogShow(this, val, "../RiskControlInformationDatabase/OperationRelatedActivitiesList.html", id); },
                PlaceEnvironmentInput: function (val, id) { DialogShow(this, val, "../RiskControlInformationDatabase/PlaceEnvironmentList.html", id); },
                ProcessMediumInput: function (val, id) { DialogShow(this, val, "../RiskControlInformationDatabase/ProcessMediumList.html", id); },
                WorkAtivitiesInput: function (val, id) { DialogShow(this, val, "../RiskControlInformationDatabase/WorkAtivitiesList.html", id); },

              
                //提交数据
                onSubmitForm: function (formName) {
                    parent.app.Form.BasedDatabaseManagementRequirements.length=0;
                    if (this.Form.OperationRelatedActivitiesRish.length > 0) {
                        for (var i = 0; i < this.Form.OperationRelatedActivitiesRish.length; i++) {
                            parent.app.Form.BasedDatabaseManagementRequirements.push(this.Form.OperationRelatedActivitiesRish[i]);
                        }
                    }
                    if (this.Form.ActivityRish.length > 0) {
                        for (var i = 0; i < this.Form.ActivityRish.length; i++) {
                            parent.app.Form.BasedDatabaseManagementRequirements.push(this.Form.ActivityRish[i]);
                        }
                    }
                    if (this.Form.OperatingProcedureRish.length > 0) {
                        for (var i = 0; i < this.Form.OperatingProcedureRish.length; i++) {
                            parent.app.Form.BasedDatabaseManagementRequirements.push(this.Form.OperatingProcedureRish[i]);
                        }
                    }
                    if (this.Form.InspectionMaintenanceActivitiesRish.length > 0) {
                        for (var i = 0; i < this.Form.InspectionMaintenanceActivitiesRish.length; i++) {
                            parent.app.Form.BasedDatabaseManagementRequirements.push(this.Form.InspectionMaintenanceActivitiesRish[i]);
                        }
                    }
                    if (this.Form.EquipmentFacilitiesRish.length > 0) {
                         
                        for (var i = 0; i < this.Form.EquipmentFacilitiesRish.length; i++) {
                            parent.app.Form.BasedDatabaseManagementRequirements.push(this.Form.EquipmentFacilitiesRish[i]);
                        }
                    }
                    if (this.Form.ProcessMediumRish.length > 0) {
                        for (var i = 0; i < this.Form.ProcessMediumRish.length; i++) {
                            parent.app.Form.BasedDatabaseManagementRequirements.push(this.Form.ProcessMediumRish[i]);
                        }
                    }
                    if (this.Form.PlaceEnvironmentRish.length > 0) {
                        for (var i = 0; i < this.Form.PlaceEnvironmentRish.length; i++) {
                            parent.app.Form.BasedDatabaseManagementRequirements.push(this.Form.PlaceEnvironmentRish[i]);
                        }
                    }
                   // parent.app.Form.BasicSecurityMeasuresOther = this.Form.BasicSecurityMeasuresOther  //其他
                  //  parent.app.Form.BasicSecurityMeasures = this.Form.BasicSecurityMeasures   //试用
                    parent.app.ListItem.dialogVisible = false;
                },
            },
            mounted: function () {     
                this.id = parent.app.Form.BasedDatabaseManagementRequirements;
                for (var i = 0; i < this.id.length; i++) {
                    this.ids += this.id[i].RiskTypeId + ',';
                }
                this.ids = this.ids.substring(0, this.ids.length-1)
                this.getData();
                this.Form.BasicSecurityMeasuresComment = "1.  三级以上的吊装作业，应编制吊装作业方案。吊装物体质量虽不足40 t，但形状复杂、刚度小、" +
                    "长径比大、 精密贵重，以及在作业条件特殊的情况下，也应编制吊装作业方案，吊装作业方案应经审批。";              
            }
        });
    </script>
</body>


</html>